/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package slicktest;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import slicktest.GameStates.GameplayState;
import slicktest.GameStates.MenuState;

import slicktest.constants.StateConstants;
import slicktest.constants.MapConstants;

/**
 *
 * @author enrightt
 */
public class TowerGame extends StateBasedGame {

    public TowerGame() throws SlickException {
        super("TTD");

        this.addState(new MenuState(StateConstants.MENU_STATE));
        this.addState(new GameplayState(StateConstants.GAMEPLAY_STATE));
        this.enterState(StateConstants.MENU_STATE);
    }

    public static void main(String[] args) {
        try {
            AppGameContainer app = new AppGameContainer(new TowerGame());
            app.setDisplayMode(MapConstants.SCREEN_WIDTH, MapConstants.SCREEN_HEIGHT, false);
            app.start();
        } catch (SlickException ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void initStatesList(GameContainer gc) throws SlickException {
        this.getState(StateConstants.MENU_STATE).init(gc, this);
        this.getState(StateConstants.GAMEPLAY_STATE).init(gc, this);

    }
}
